package service

//设备统计数据模型
type DeviceStats struct {
	TotalDevices  int     `json:"total"`
	GrowthRate    float64 `json:"growthRate"`
	OnlineDevices int     `json:"online"`
	OnlineRate    float64 `json:"onlineRate"`
	FaultDevices  int     `json:"faultDevices"`
	PendingFaults int     `json:"pendingFaults"`
	TodayAlerts   int     `json:"todayAlerts"`
	NewAlerts     int     `json:"newAlerts"`
}

func GetDeviceStatusFromDB() DeviceStats {
	// 模拟从数据库获取设备状态数据
	return DeviceStats{
		TotalDevices:  150,
		GrowthRate:    5.4,
		OnlineDevices: 120,
		OnlineRate:    80.0,
		FaultDevices:  10,
		PendingFaults: 3, // "未处理"数量
		TodayAlerts:   7,
		NewAlerts:     2, // "新告警"数量
	}
}
